package cn.sumpu.app.coolsk.biz;

import java.util.*;

import javax.servlet.http.HttpServletRequest;

import cn.sumpu.app.coolsk.domain.*;
import cn.sumpu.app.coolsk.exception.AppBusinessException;
import cn.sumpu.toolkit.common.page.PageModel;

public interface ContentBiz {

	/**
	 * author BruceZhang
	 * @param content
	 * 添加内容
	 * @throws AppBusinessException
	 */
	Content addContent(Content content)throws AppBusinessException;
	/**
	 * author BruceZhang
	 * @param id
	 * 删除内容
	 * @throws AppBusinessException
	 */
	void deleteContent(String id)throws AppBusinessException;
	/**
	 * author BruceZhang
	 * @param content
	 * 更新内容
	 * @throws AppBusinessException
	 */
	void updateContent(Content content)throws AppBusinessException;
	/**
	 * author BruceZhang
	 * @param channel	频道号
	 * @return	通过频道查询最小的排序号
	 * @throws AppBusinessException
	 */
	Integer getMinSortByChannel(String channel)throws AppBusinessException;
	/**
	 * author BruceZhang
	 * @param channel	频道号
	 * @param type		1.上移 2.下移
	 * @return	根据条件查询排序内容
	 * @throws AppBusinessException
	 */
	Content getSortByCondition(Integer type, String channel, Integer sort)throws AppBusinessException;
	/**
	 * author BruceZhang
	 * @param channel
	 * @return 取得后台内容
	 * @throws AppBusinessException
	 */
	PageModel getBackContent(String channel, Integer pageSize, Integer page)throws AppBusinessException;
	//取得后台内容总条数
	Integer getBackContentCount(String channel)throws AppBusinessException;
	/**
	 * author BruceZhang
	 * @param map
	 * 根据条件查询存在多少条
	 * @throws AppBusinessException
	 */
	Integer getContentExists(String channel, String tblName, String tblId)throws AppBusinessException;
	/**
	 * author BruceZhang
	 * @param id	内容ID
	 * @return	通过ID取得某条内容
	 * @throws AppBusinessException
	 */
	Content getContentById(String id)throws AppBusinessException;
	/**
	 * author BruceZhang
	 * @param channel	栏目标识
	 * @param number	条数
	 * @return	根据栏目取得内容(在前台展示)
	 * @throws AppBusinessException
	 */
	List<Content> getContentByChannel(String channel, Integer number)throws AppBusinessException;
	List<Content> getContentByChannel(String channel)throws AppBusinessException;
	//取得首页内容
	void getIndexContent(HttpServletRequest request);
	
	/**
	 * BruceZhang
	 * @param channel	频道ID
	 * @param number	条数
	 * @return			查询推送的门票
	 * @throws AppBusinessException
	 */
	List<Content> getTicketByChannel(String channel, Integer number)throws AppBusinessException;
	/**
	 * BruceZhang
	 * @param channel	频道ID
	 * @param number	条数
	 * @return			查询推送的酒店
	 * @throws AppBusinessException
	 */
	List<Content> getHotelByChannel(String channel, Integer number)throws AppBusinessException;
	/**
	 * BruceZhang
	 * @param channel	频道ID
	 * @param number	条数
	 * @return			查询推送的产品
	 * @throws AppBusinessException
	 */
	List<Content> getProductByChannel(String channel, Integer number)throws AppBusinessException;
	/**
	 * BruceZhang
	 * @param channel	频道ID
	 * @param number	条数
	 * @return			查询推送的景区
	 * @throws AppBusinessException
	 */
	List<Content> getScenicByChannel(String channel, Integer number)throws AppBusinessException;
	/**
	 * author BruceZhang
	 * @param channel	频道ID
	 * @param number	条数
	 * @return	查询推送的点评
	 * @throws AppBusinessException
	 */
	List<Content> getDiscussByChannel(String channel, Integer number)throws AppBusinessException;
	/**
	 * author BruceZhang
	 * @param channel	频道ID
	 * @param number	条数
	 * @return	查询推送的行程
	 * @throws AppBusinessException
	 */
	List<Content> getTripByChannel(String channel, Integer number)throws AppBusinessException;
	
	PageModel getListViewContentByChannel(String channel, Integer pageSize, Integer page)throws AppBusinessException;
	
	/**
	 * 
	 * @param channel
	 * @param pageSize
	 * @param page
	 * @param listAll true:显示所有列表 false:排除首页显示的列表
	 * @return
	 * @throws AppBusinessException
	 */
	public PageModel getListViewContentByChannel(String channel, Integer pageSize,Integer page,boolean listAll) throws AppBusinessException;
	
	/**
	 * author grieous
	 * 搜索频道表内容
	 * @param channel
	 * @param title
	 * @return
	 * @throws AppBusinessException
	 */
	public PageModel searchContent(Integer page,String channelType,String title)throws AppBusinessException;
}
